060262151ef35bc209c9b1a140ec83b5b7e35c32,core/src/main/java/org/radargun/stages/test/legacy/LegacyStressor.java,LegacyStressor,makeRequest,#Invocation#boolean#,129
Before Change
T result = null;
boolean successful = true;
Exception exception = null;
long start = TimeService.nanoTime();
long operationDuration;
try {
result = invocation.invoke();
operationDuration = TimeService.nanoTime() - start;
// make sure that the return value cannot be optimized away
// however, we can't be 100% sure about reordering without
// volatile writes/reads here
Blackhole.consume(result);
if (countForTx) {
txRemainingOperations--;
}
} catch (Exception e) {
operationDuration = TimeService.nanoTime() - start;
log.warn("Error in request", e);
successful = false;
txRemainingOperations = 0;
exception = e;
}
transactionDuration += operationDuration;
if (useTransactions && txRemainingOperations <= 0) {
endTransactionAndRegisterStats(stage.isSingleTxType() ? invocation.txOperation() : null);
}
if (recording()) {
if (successful) {
stats.registerRequest(operationDuration, invocation.operation());
} else {
stats.registerError(operationDuration, invocation.operation());
}
After Change
Request request = recording() ? stats.startRequest() : null;
try {
result = invocation.invoke();
succeeded(request, invocation.operation());
// make sure that the return value cannot be optimized away
// however, we can't be 100% sure about reordering without
// volatile writes/reads here